import { Link, useNavigate } from "react-router-dom";

export default function test() {
    const navigate = useNavigate(); // 获取 navigate hook
    // 跳转到首页
    return (
        <div>
            <Link to='/home'>跳转到首页</Link>
            <button onClick={() => navigate('/home')}>跳转到首页</button>
        </div>
    )
}
